GXSkewShape
You can use theGXSkewShape
function to skew a shape about a specified origin by specified horizontal and vertical factors.
void GXSkewShape(gxShape target, Fixed xSkew, Fixed ySkew, Fixed xOffset, Fixed yOffset);
target
- A reference to the shape you want to skew.
hSkew
- The amount to skew the shape horizontally.
vSkew
- The amount to skew the shape vertically.
xOffset
- The horizontal coordinate of the origin to skew the shape about.
yOffset
- The vertical coordinate of the origin to skew the shape about.
DESCRIPTION
TheGXSkewShape
function skews the shape referenced by thetarget
parameter horizontally by the factor specified in thehSkew
parameter and vertically by the factor specified in thevSkew
parameter. The skewing is centered about the origin specified in thexOffset
andyOffset
parameters. (The origin is the point whose coordinates do not change as a result of the skewing operation.)The skew factors are expressed as a proportional amount of shift in one direction with distance in the perpendicular direction. A value of
0
for thehSkew
orvSkew
parameter indicates no skewing in the corresponding direction.This function skews the target shape in one of two ways:
The target shape can be any shape type. However, if the target shape is an empty shape, a full shape, or a picture shape, this function has no effect unless the shape's
- If the target shape's
gxMapTransformShape
attribute is cleared, the function recalculates the control points of the shape's geometry to effect the skewing.- If the target shape's
gxMapTransformShape
attribute is set, this function is identical to theGXSkewTransform
function; it recalculates the mapping matrix of the target shape's transform object to effect the skewing. If the target shape shares this transform object with other shapes, QuickDraw GX makes a copy of the transform object, associates the copy with the target shape, and makes changes to the copy.
gxMapTransformShape
attribute is set.The coordinates of the origin are specified in geometry space.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil shape_access_not_allowed (debugging version) Warnings skew_shape_out_of_range graphic_type_cannot_be_moved Notices (debugging version) mapping_unaffected SEE ALSO
For examples of the use of this function, see Listing 6-4 on page 6-25 and Listing 6-5 on page 6-27.To skew a shape by altering the mapping property of its transform object, you can also use the
GXSkewTransform
function, described on page 6-63.